import {action, observable, set} from "mobx-miniprogram"
import {getStorageSync} from "../utils/storage"
const  store = observable({
    token:getStorageSync(),
    user:{},
    setToken:action(function(value){
        // console.log("token");
        this.token = value
    }),
    setUser:action(function(value){
        this.user = value
    }),
    // 修改日期
    setUserBirthday:action(function(value){
        this.user = {
            ...this.user,
            birthday: value
        }
    }),
    // 修改性别
    setUserGender:action(function(value){
        this.user={
            ...this.user,
            gender : value
        }
    }),
    // 修改name
    setUserName:action(function(value){
        this.user={
            ...this.user,
            name : value
        }
    })
})

export default store